package com.yunxiangyue

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper


const val dbName2="dbName2"
const val tab="commentsInfo"
class comment_db(context: Context,dbName2:String,version:Int):SQLiteOpenHelper(context,dbName2,null,version){


    override fun onCreate(db: SQLiteDatabase?) {
        db?.execSQL("create table $tab(id integer primary key autoincrement,bitmap blob not null,name text,date text,comment text )")
    }



    override fun onUpgrade(db: SQLiteDatabase?, p1: Int, p2: Int) {
        db?.execSQL("drop table if exists $tab")
        if(tab==null){
            onCreate(db)
        }
        onCreate(db)
    }

}